<?php
/**
 * 留言管理
 */

namespace backend\controllers;


use common\models\Message;

class MessageController extends CommonController
{
    public function actionIndex()
    {
        $this->setQuery(Message::find()->orderBy("id desc"));
        return $this->query();
    }

    public function actionView($id)
    {
        $model = Message::findOne($id);
        return $this->render('view', ['model' => $model]);
    }

    public function actionDelete()
    {
        $this->setModel(new Message());
        $this->delete();
    }
}